//大鱼绘制
var momObj = function()
{
	this.x;
	this.y;
	this.angle;

	this.momTailTimer = 0;
	this.momTailCount = 0;

	this.momEyeTimer = 0;
	this.momEyeCount = 0;
	this.momEyeInterval = 1000;

	this.momBobyCount = 0;
}
momObj.prototype.init = function() 
{
	this.x = canWidth * 0.5;
	this.y = canHeight * 0.5;
	this.angle = 0;

}
momObj.prototype.draw = function()
{
	// 跟随鼠标移动
	this.x = lerpDistance(mx,this.x, 0.9);
	this.y = lerpDistance(my,this.y, 0.9);

	//获取鼠标角度
	var deltaY = my - this.y;
	var deltaX = mx - this.x;
	var beta = Math.atan2(deltaY,deltaX) + Math.PI;

	//lerp x,y
	this.angle = lerpAngle(beta,this.angle,0.6);//鼠标角度的快慢

	this.momTailTimer += deltaTime;
	if (this.momTailTimer > 50) 
	{
		this.momTailCount = (this.momTailCount +1) % 8;
		this.momTailTimer %= 50; 
	}

	this.momEyeTimer += deltaTime;
	if (this.momEyeTimer > this.momEyeInterval) 
	{
		this.momEyeCount = (this.momEyeCount + 1) % 2;
		this.momEyeTimer %= this.momEyeInterval;

		if (this.momEyeCount == 0) 
		{
			this.momEyeInterval = Math.random() * 1500 + 2000;
		}else
		{
			this.momEyeInterval = 200;
		}
	}
	ctx1.save();
	ctx1.translate(this.x,this.y);
	ctx1.rotate(this.angle);
	//大鱼尾巴
	var momTailCount = this.momTailCount;
	ctx1.drawImage(momTail[momTailCount],- momTail[momTailCount].width * 0.5 + 30,- momTail[momTailCount].height * 0.5);
	var momBobyCount = this.momBobyCount;
	if (data.double == 1) 
	{
		ctx1.drawImage(momBobyOra[momBobyCount],- momBobyOra[momBobyCount].width * 0.5,- momBobyOra[momBobyCount].height * 0.5);
	}else
	{
		ctx1.drawImage(momBobyBlue[momBobyCount],- momBobyOra[momBobyCount].width * 0.5,- momBobyOra[momBobyCount].height * 0.5);
	}
	var momEyeCount = this.momEyeCount;
	ctx1.drawImage(momEye[momEyeCount],- momEye[momEyeCount].width * 0.5,- momEye[momEyeCount].height * 0.5);

	ctx1.restore();
}